import request from "./request";

export function getStuListApi() {
    return request({
        url: '/students',
        method: 'GET'
    })
}
export function addStuApi(data) {
    return request ({
        url: '/students',
        method:'POST',
        data
    })
}

export function getStuByIdApi(id) {
    return request({
        url: `/students/${id}`,
        method: 'GET'
    })
}

export function deleteStuById(id) {
    return request({
        url: `/students/${id}`,
        method: 'DELETE'
    })
}

export function editStuByIdApi(id, data){
    return request ({
        url: `/students/${id}`,
        method: 'PATCH',
        data
    })
}